package org.jeecg.modules.zhima.center.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.zhima.center.entity.UmsSearchHistory;
import org.jeecg.modules.zhima.center.mapper.UmsSearchHistoryMapper;
import org.jeecg.modules.zhima.center.service.IUmsSearchHistoryService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: ums_search_history
 * @Author: jeecg-boot
 * @Date:   2020-09-15
 * @Version: V1.0
 */
@Service
public class UmsSearchHistoryServiceImpl extends ServiceImpl<UmsSearchHistoryMapper, UmsSearchHistory> implements IUmsSearchHistoryService {

    @Override
    public List<UmsSearchHistory> listByUserId(Integer userId, Integer limit) {
        return list(new LambdaQueryWrapper<UmsSearchHistory>().eq(UmsSearchHistory::getUserId, userId).last("limit " + limit));
    }
}
